package com.woniu.order.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 销售订单表，包含订单信息、销售员、价格、审批状态等信息
 * @TableName zf_traderordera
 */
@TableName(value ="zf_traderordera")
@Data
public class ZfTraderordera implements Serializable {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 订单申请编号（唯一）
     */
    private String code;

    /**
     * 销售员code码
     */
    private String salesmanCode;

    /**
     * 税额
     */
    private BigDecimal taxAmount;

    /**
     * 销售数量
     */
    private Integer salesQuantity;

    /**
     * 订单签订日期
     */
    private String orderDate;

    /**
     * 订单总原价
     */
    private BigDecimal totalOriginalPrice;

    /**
     * 折扣率
     */
    private BigDecimal discountRate;

    /**
     * 优惠金额
     */
    private BigDecimal discountAmount;

    /**
     * 订单金额（含税）
     */
    private BigDecimal totalPriceWithTax;

    /**
     * 订单金额（不含税）
     */
    private BigDecimal totalPriceWithoutTax;

    /**
     * 订单毛利率
     */
    private BigDecimal grossMargin;

    /**
     * 审批状态（0等待经理审批，1等待总监审批，2完成审批）
     */
    private Integer approvalStatus;

    /**
     * 产品
     */
    private String product;

    /**
     * 分销商
     */
    private String distributor;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 修改日期
     */
    private Date modifiedDate;

    /**
     * 分销商联系方式
     */
    private String modifiedTel;

    /**
     * 记录创建时间
     */
    private String tradeCode;

    /**
     * 记录更新时间
     */
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ZfTraderordera other = (ZfTraderordera) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
            && (this.getSalesmanCode() == null ? other.getSalesmanCode() == null : this.getSalesmanCode().equals(other.getSalesmanCode()))
            && (this.getTaxAmount() == null ? other.getTaxAmount() == null : this.getTaxAmount().equals(other.getTaxAmount()))
            && (this.getSalesQuantity() == null ? other.getSalesQuantity() == null : this.getSalesQuantity().equals(other.getSalesQuantity()))
            && (this.getOrderDate() == null ? other.getOrderDate() == null : this.getOrderDate().equals(other.getOrderDate()))
            && (this.getTotalOriginalPrice() == null ? other.getTotalOriginalPrice() == null : this.getTotalOriginalPrice().equals(other.getTotalOriginalPrice()))
            && (this.getDiscountRate() == null ? other.getDiscountRate() == null : this.getDiscountRate().equals(other.getDiscountRate()))
            && (this.getDiscountAmount() == null ? other.getDiscountAmount() == null : this.getDiscountAmount().equals(other.getDiscountAmount()))
            && (this.getTotalPriceWithTax() == null ? other.getTotalPriceWithTax() == null : this.getTotalPriceWithTax().equals(other.getTotalPriceWithTax()))
            && (this.getTotalPriceWithoutTax() == null ? other.getTotalPriceWithoutTax() == null : this.getTotalPriceWithoutTax().equals(other.getTotalPriceWithoutTax()))
            && (this.getGrossMargin() == null ? other.getGrossMargin() == null : this.getGrossMargin().equals(other.getGrossMargin()))
            && (this.getApprovalStatus() == null ? other.getApprovalStatus() == null : this.getApprovalStatus().equals(other.getApprovalStatus()))
            && (this.getProduct() == null ? other.getProduct() == null : this.getProduct().equals(other.getProduct()))
            && (this.getDistributor() == null ? other.getDistributor() == null : this.getDistributor().equals(other.getDistributor()))
            && (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
            && (this.getModifiedDate() == null ? other.getModifiedDate() == null : this.getModifiedDate().equals(other.getModifiedDate()))
            && (this.getModifiedTel() == null ? other.getModifiedTel() == null : this.getModifiedTel().equals(other.getModifiedTel()))
            && (this.getTradeCode() == null ? other.getTradeCode() == null : this.getTradeCode().equals(other.getTradeCode()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getSalesmanCode() == null) ? 0 : getSalesmanCode().hashCode());
        result = prime * result + ((getTaxAmount() == null) ? 0 : getTaxAmount().hashCode());
        result = prime * result + ((getSalesQuantity() == null) ? 0 : getSalesQuantity().hashCode());
        result = prime * result + ((getOrderDate() == null) ? 0 : getOrderDate().hashCode());
        result = prime * result + ((getTotalOriginalPrice() == null) ? 0 : getTotalOriginalPrice().hashCode());
        result = prime * result + ((getDiscountRate() == null) ? 0 : getDiscountRate().hashCode());
        result = prime * result + ((getDiscountAmount() == null) ? 0 : getDiscountAmount().hashCode());
        result = prime * result + ((getTotalPriceWithTax() == null) ? 0 : getTotalPriceWithTax().hashCode());
        result = prime * result + ((getTotalPriceWithoutTax() == null) ? 0 : getTotalPriceWithoutTax().hashCode());
        result = prime * result + ((getGrossMargin() == null) ? 0 : getGrossMargin().hashCode());
        result = prime * result + ((getApprovalStatus() == null) ? 0 : getApprovalStatus().hashCode());
        result = prime * result + ((getProduct() == null) ? 0 : getProduct().hashCode());
        result = prime * result + ((getDistributor() == null) ? 0 : getDistributor().hashCode());
        result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
        result = prime * result + ((getModifiedDate() == null) ? 0 : getModifiedDate().hashCode());
        result = prime * result + ((getModifiedTel() == null) ? 0 : getModifiedTel().hashCode());
        result = prime * result + ((getTradeCode() == null) ? 0 : getTradeCode().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", code=").append(code);
        sb.append(", salesmanCode=").append(salesmanCode);
        sb.append(", taxAmount=").append(taxAmount);
        sb.append(", salesQuantity=").append(salesQuantity);
        sb.append(", orderDate=").append(orderDate);
        sb.append(", totalOriginalPrice=").append(totalOriginalPrice);
        sb.append(", discountRate=").append(discountRate);
        sb.append(", discountAmount=").append(discountAmount);
        sb.append(", totalPriceWithTax=").append(totalPriceWithTax);
        sb.append(", totalPriceWithoutTax=").append(totalPriceWithoutTax);
        sb.append(", grossMargin=").append(grossMargin);
        sb.append(", approvalStatus=").append(approvalStatus);
        sb.append(", product=").append(product);
        sb.append(", distributor=").append(distributor);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", modifiedDate=").append(modifiedDate);
        sb.append(", modifiedBy=").append(modifiedTel);
        sb.append(", createTime=").append(tradeCode);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}